import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/sample',
    name: 'sample',
    meta,
    redirect: { name: 'sample' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'list',
            name: `${pre}list`,
            component: _import('sample/list'),
            meta: {
                ...meta,
                title: '普通列表'
            }
        },
		{
		    path: 'add',
		    name: `${pre}add`,
		    component: _import('sample/add'),
		    meta: {
		        ...meta,
		        title: '添加表单'
		    }
		},
		{
		    path: 'add2',
		    name: `${pre}add2`,
		    component: _import('sample/add2'),
		    meta: {
		        ...meta,
		        title: '添加表单'
		    }
		}
    ])('sample-')
}
